class C:
    def __init__(self, x):
        self.x = x


c = C(250)
print(c.x)

print(c.__dict__)  # {'x': 250}

c.y = 520
print(c.__dict__)  # {'x': 250, 'y': 520}

c.__dict__['z'] = 666
print(c.__dict__)  # {'x': 250, 'y': 520, 'z': 666}

# 对象的属性底层就是通过一个字典来实现的


# 字典是通过空间换时间的方式实现的，比较浪费空间

